<?php

class Groups_Model_DbTable_Groups extends Zend_Db_Table_Abstract {

    protected $_name = 'groups';

    public function getRoles($idgroup) {
        return $this->fetchRow('idgroup = ' . (int) $idgroup);
    }

    public function getName($idgroup) {
        $data = $this->fetchRow('idgroup = ' . (int) $idgroup);
        return $data['name'];
    }

    public function getCombo() {
        $select = $this->_db->select()
                ->from($this->_name, array('key' => 'idgroup', 'value' => 'name'));
        $result = $this->getAdapter()->fetchAll($select);
        return $result;
    }

    public function add($data) {
        $this->insert($data);
    }

}

?>
